package com.tb.controller;

import com.tb.pojo.College;
import com.tb.service.CollegeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
public class CollegeController {

    @Autowired
    private CollegeService cs;

    @GetMapping("/getCollege")
    public ModelAndView getCollege(ModelAndView mav) {
        List<College> collegeList = cs.findAll();
        mav.addObject("collegeList", collegeList);
        mav.setViewName("/teacher/information");
        System.out.println(collegeList);
        return mav;
    }
}
